<?php

namespace app\adminmall\controller;
use app\adminmall\model\OrderModel;
use app\common\controller\AdminBaseController;
use think\Db;
/**
 * 订单统计
 */
class OrderEnterController extends AdminBaseController
{
 	protected $model;
	
    protected function _initialize() {
        parent::_initialize();
        $this->model = new OrderModel();
    }
    /**
     * 订单统计
     * @author [lx] 
     */
    public function index( $page = 1){
		//本日订单统计
		$todaysum = Db::name("mall_order")->whereTime('order_time','today')->count('id');
        $this->assign('todaysum',$todaysum);
		
		//本周订单统计
		$weeksum = Db::name("mall_order")->whereTime('order_time','week')->count('id');
        $this->assign('weeksum',$weeksum);
		
		//本月订单统计
		$monthsum = Db::name("mall_order")->whereTime('order_time','month')->count('id');
        $this->assign('monthsum',$monthsum);
		
		//全部订单统计
		$sum = Db::name("mall_order")->count('id');
        $this->assign('sum',$sum);
        return $this->fetch();
    }


   
}